/**
 * Copyright &copy; 2013-2016 山东易科德软件有限公司   All rights reserved.
 */
package cn.net.ecode.elec.ad.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.net.ecode.common.persistence.Page;
import cn.net.ecode.common.service.CrudService;
import cn.net.ecode.elec.ad.entity.ElecAd;
import cn.net.ecode.elec.ad.dao.ElecAdDao;

/**
 * 广告管理Service
 *
 * @author AlanShelby
 * @version 2019-08-26
 */
@Service
@Transactional(readOnly = true)
public class ElecAdService extends CrudService<ElecAdDao, ElecAd> {

    /**
     * 获取单条数据
     *
     * @param elecAd
     * @return
     */
    public ElecAd get(ElecAd elecAd) {
        return super.get(elecAd);
    }

    /**
     * @Method getByType
     * @Description 根据类型获取单条数据
     * @Author AlanShelby
     * @Date 14:17 2019/8/26 0026
     * @Param [type - 广告类型（详见系统字典 app_imgae_type）]
     * @Return cn.net.ecode.elec.ad.entity.ElecAd
     */
    public ElecAd getByType(String type) {
        return dao.getByType(type);
    }

    /**
     * 查询列表数据
     *
     * @param elecAd
     * @return
     */
    public List<ElecAd> findList(ElecAd elecAd) {
        return super.findList(elecAd);
    }

    /**
     * 查询分页数据
     *
     * @param page   分页对象
     * @param elecAd
     * @return
     */
    public Page<ElecAd> findPage(Page<ElecAd> page, ElecAd elecAd) {
        return super.findPage(page, elecAd);
    }

    /**
     * 保存数据（插入或更新）
     *
     * @param elecAd
     */
    @Transactional(readOnly = false)
    public void save(ElecAd elecAd) {
        super.save(elecAd);
    }

    /**
     * 删除数据
     *
     * @param elecAd
     */
    @Transactional(readOnly = false)
    public void delete(ElecAd elecAd) {
        super.delete(elecAd);
    }

}